Skip to content

feat(#1549): copy files between multiple vim instances#3334

Open
Uanela wants to merge 12 commits into
masterfrom
feat/operation-between-instances
Open

feat(#1549): copy files between multiple vim instances#3334
Uanela wants to merge 12 commits into
masterfrom
feat/operation-between-instances

Conversation

@Uanela

@Uanela Uanela commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Closes #1549

Summary

This PR introduces the feature to allow copying files between multiple vim instances plus some code small refactors to improve the codebase.

Changes

  • core changes where made into clipboard by reusing copy_absolute_path and paste by passing opts with use_protocol.
  • keymaps added bgy - copy using protocol and bgp paste using protocol (prefered bgy+bgp instead of bgy+gp from copy files between multiple vim instances #1549 because of consistency and I tell from own xp while testing)
  • Added customizable protocol label through actions.clipboard.protocol
  • Made copy_basename and copy_absolute_path visual capable, reason almost ZERO for me, but I think is something users would expect to exist, mainly now that we've many visual operations

What Can Be Improved (My thoughts)

1 - Maybe rename bgy to bgc to be consistent with c our current copy key
2 - Maybe add bgx to allow cutting the files (which will only add a slight change into the copied text), and if we want to allow cutting should it be on copying to clipboard time or decide when pasting, e.g:

  • bgx and then bgp, basically I decided to cut on copying to clipboard time
  • bgc and then bgp (copy) or bgxp (or whatever) to mean paste
  • or apply both.
    I am leaning more toward first option to match what we do in our OS already we decide cut/copy at the time we are selecting the file(s).

BTW this was a wild and exciting PR for me, the conversation under #1549 and the changes regarding visual copy/cut/delete from @v3ceban helped a lot.

@Uanela

Uanela commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

I am here thinking about the protocol thing, I think maybe it should be removed so that it can allow me to easily copy file from my OS explorer to nvim basically I copy the path the bgp and done.

I we gotta build extensions for OS.

@Uanela

Uanela commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

Then if we remove the protocol we have no need to a new command like bgy just do gy in n or x and get the list of file paths, the gp to paste those.

@alex-courtis

Copy link
Copy Markdown
Member
  • bgx and then bgp, basically I decided to cut on copying to clipboard time

That sounds like a reasonable solution that would avoid a lot of complexity. The user will be explicitly cutting and will be aware of this behaviour.

Looking great, I'll get to a review shortly.

@alex-courtis

Copy link
Copy Markdown
Member

I am here thinking about the protocol thing, I think maybe it should be removed so that it can allow me to easily copy file from my OS explorer to nvim basically I copy the path the bgp and done.

That would be very useful.

I've had a very quick look at the XDG spec for extended clipboard handling but found nothing. Experimentation is needed.

@Uanela

Uanela commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

Should I remove the protocol for a while?

@alex-courtis

Copy link
Copy Markdown
Member

Should I remove the protocol for a while?

If it works now, leave it. We can change it later if we want, as we don't need to worry about compatibility.

@Uanela

Uanela commented Jun 12, 2026 via email

Copy link
Copy Markdown
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

copy files between multiple vim instances

2 participants